package com.ywwxhz.common;


import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;

public final class Constants {

    private Constants() {
        // hide me
    }

    public static final String TAG = "GKT";

    public static String LOCALE = Locale.getDefault().toString();

    public static final String DEFAULT_BLANK = "";
    public static final String DEFAULT_SPACE = " ";

    public static final SimpleDateFormat FMT_DATE_TIME = new SimpleDateFormat(Locale.getDefault().toString().equals("zh_CN") ? "yyyy-MM-dd HH:mm:ss" : "M/d/yyyy HH:mm:ss", Locale.getDefault());
    public static final SimpleDateFormat FMT_DATE = new SimpleDateFormat(Locale.getDefault().toString().equals("zh_CN") ? "yyyy-MM-dd" : "M/d/yyyy", Locale.getDefault());
    public static final SimpleDateFormat FMT_TIME = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
    public static final SimpleDateFormat FMT_TIME_MINUTE = new SimpleDateFormat("HH:mm", Locale.getDefault());

    /**
     * 保留两位小数，如果有的话
     */
    public static final DecimalFormat FMT_DECIMAL = new DecimalFormat("#.##");
    /**
     * 强制保留两位小数
     */
    public static final DecimalFormat FMT_DECIMAL_FORCE = new DecimalFormat("0.00");

//    public static final String[] STS=new String[]{"MQNAW","HXNDX","WSZDANXD","WXNGZQM","MQIMYSM"};

    /**
     * 经纬度坐标组分隔符
     */
    public static final String POSI_GROUP_SEP = ";";
    /**
     * 经纬度坐标分隔符
     */
    public static final String POSI_ITEM_SEP = ",";

    /**
     * 地球半径（单位：米），来自NASA网站：
     * http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
     */
    public static final Double EARTH_RADIUS = 6371000D;

    public static final String REFRESH_FLAG = "REFRESH_FLAG";

    public static final int NOTIFIACTION_ID = 19831022;

    public static final int HEART_BEAT_INTERVAL = 120000;

    public static final int RECEIVE_INTERVAL = 1000;

    public static final int PACKAGE_BODY_LENGTH = 3072;

    public static boolean hasNewVersion = false;

    public static final String UPDATE_SESSION_LOCATION = "UPD_SESSION_LOC";

    public static final float MAX_PIC_WIDTH_HEIGHT = 1200f;

    public final static int CHAT_MSG = 9990;
    public final static int CHAT_LOGIN = 9991;

    public static final String ACTION_NEW_MSG = "com.xx.MSG_RECEIVED";

    public static final String REGX_IP_PORT = "^(\\d{1,3}\\.){3}\\d{1,3}(\\:|\\ )\\d{3,5}$";

    public static final String REGX_EMOJI = "\\[zgif\\d+?\\.gif\\]";

    public static final String REGX_EMAIL = "^.+?@.+?\\.[a-zA-Z]{1,6}$";

    public final static String PROTOCOL_KEY = "USER_PROTOCOL";

    /**
     * 结尾不带 "/"
     */
    public static String baseUrl;
    public static String CFG_PUBLIC_KEY;

    public static String baseServerIP;

    public static final long MSG_TIMEOUT = 30000;//30秒

    public static final int MAX_RECEIVE_LENGTH = 1048576;//1MB

    public static final String SPELLING_SEPARATOR = " ";


    //Intent keys
    public static final String INTENT_MEASURE = "MEASURE";

    public static final String PIC_PATH = "PIC_PATH";

    public static final int NULL_VALUE = 9999;    //无意义参数
    public static final int COMMENT_FILE = 399;    //启动消息界面的标识
    public static final int PUBLISH_COMMENT = 399;    //启动消息界面的标识

    public static final String MSG_VOICE = "MSG_VOICE";
    public static final String MSG_VIBRATE = "MSG_VIBRATE";
    public static final String MSG_VOICE_KEEP = "MSG_VOICE_KEEP";

    public static final String VOLUME = "volume"; //音量调整的SP key

    public static final String BLE_CONNECTED_FAIL = "ble_connected_fail";//蓝牙连接失败
    public static final String BLE_ACTION_DISCONNECTED = "ble_action_disconnected"; //蓝牙设备已断开
    public static final String VIBRATOR_CLOSE = "vibrator_close"; //震动关闭的广播
    public static final String CONNECT_BLE = "connectble"; //BtActivity用于连接蓝牙的action
    public static boolean isBlutActivityOpen = false;
    public static final String BLE_ADDRESS = "ble_address"; //用于intent传蓝牙mac的key
    public static boolean isBleConnected = false; //蓝牙是否处理连接状态
    public static boolean isActivityConnected = false;  //蓝牙连接是否是主动断开
    public static boolean isBleDisconnected = false; //蓝牙是否断开
    public static final int BLE_PRESCAN_PERIOD = 30000;
    public static final int BLE_SCAN_PERIOD = 10000;
    public static final int BLE_FAILED_SCAN_PERIOD = 1000;
    public static final int BLE_FAILED_RETRY_TIME = 2;

    public static final int REQUEST_INTERVAL = 2000;

    public static final int CAMERA_REQUEST_CODE = 11001; //调用像机的请求码
    public static final int RESULT_REQUEST_CODE = 11002; //调用图片裁剪的请求码

    /**
     * 作为title显示到手表的最大ASCII字符长度
     * 一个非ASCII字符算两个ASCII字符
     */
    public static final int MAX_WATCH_TITLE_DISPLAY_LEN = 6;

    public static final int ALARM_MAX_TITLE_LEN = 10; //闹钟标题的最大ASCII字符长度
    public static final int ALARM_MAX_CONTENT_LEN = 30; //闹钟内容的最大ASCII字符长度


    public static final int VALIDCODE_TOTAL_TIME = 120000; //获取验证码的倒计时时长，单位毫秒
    public static final int VALIDCODE_APART_TIME = 1000; //计时的时间间隔，1000毫秒

    public static final String SETTING_DOMAIN = "DOMAIN";
    public static final String SETTING_SERVER_IP = "SERVER_IP";
    public static final String SETTING_SERVER_URL = "SERVER_URL";
    public static final String SETTING_NAVI_MAP = "navi_map";
    public static final String SETTING_SHOW_MAP_TOOLS = "SHOW_MAP_TOOLS";
    public static final String SETTING_STOP_PROCESSING = "STOP_PROCESSING";
    public static final String SETTING_VERSION_CHOICE_INTEL = "VERSION_CHOICE_INTEL";

    public static final String MANAGER_USER_NUM = "1";

    public static final int SORT_MANAGER = 1;
    public static final int SORT_KEEPER = 5;
    public static final int SORT_FRIEND = 10;
    public static final int SORT_MONITOR_OBJECT = 15;

    public static final int MAP_LEVEL = 16;

    public static final String SCHEME_FILE = "file://";
    public static final String SCHEME_ASSETS = "assets://";
    public static final String SCHEME_RES = "res://";

    public static int VOICE_MAX_TIME = 15; // 最长录制时间，单位秒，0为无时间限制
    public static int SERIAL_BEGIN = 50;
    public static int MAX_RESEND_TIMES = 2;
    public static int RESEND_INTERVAL = 10000;//10秒

    public static final double VOLTAGE_UPPER = 4.17;
    public static final double VOLTAGE_LOWER = 3.4;

    public static final int TERM_TYPE_BRACELET = 1;

    public static final int TIME_SENSOR = 200;

    public static String secKey;
    /**
     * 是否使用加密
     */
    public static boolean secUse;

    public static int versionCode;
    public static String versionName;

    public static final String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";

    public static final String TIME_ZONE_PREFIX = "UTC ";
    public static final String PREFIX_BLACKLIST = "BLACKLIST_";


    public static final String CHINA = Locale.CHINA.toString();
    public static boolean IS_CHINA_VERSION = true;
    public static final String CONTACT_GROUP_NAME = "DDX";
    public static final String SHOWN_CONTACT_PERMISSION = "SHOWN_CONTACT_PERMISSION";
    /**
     * 中国大陆常规手机号码与紧急号码，如110等
     */
    public static final String MOBILE_FMT_CHINA = "^((\\+?86)?1\\d{10}|(\\d{3}))$";
    /**
     * 国际手机号格式
     */
    public static final String MOBILE_FMT_I18N = "^\\+?\\d{1,16}$";

    public static final String EXCEPTION_LOG_UPLOAD = "EXCEPTION_LOG_UPLOAD";
    public static String UPDATE_URL;

    public static final String ACCESS_KEY="authmark";

    public static final int INTERVAL_WARN_TIME = 30000;

    public static final String SAVED_BAND_MAC = "SAVED_BAND_MAC";
    public static final String TYPE_TIME = "TYPE_TIME";

    public static final String USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3004.3 Safari/537.36";

}